// agent-ui/src/api/movie/movieApi.js

import axios from 'axios';
import { processMoviePoster, processMoviePosters } from '@/utils/imageUtils';

const movieApi = {
    // 根据ID获取电影信息
    getMovieById(movieId) {
        return axios.get(`http://localhost:9527/movies/${movieId}`).then(response => {
            return processMoviePoster(response.data);
        });
    },

    // 获取所有电影
    getAllMovies() {
        return axios.get('http://localhost:9527/movies').then(response => {
            return processMoviePosters(response.data);
        });
    }
};

export default movieApi; 